<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>将英文样式作为候补样式</title>
    <link rel="stylesheet" type="text/css" href="main.css"/>
    <link rel="stylesheet" type="text/css" href="zh.css" title="Chinese"/>
    <link rel="stylesheet" type="text/css" href="fr.css" title="French" disabled = true />
    <link rel="alternate stylesheet" type="text/css" href="en.css" title="English"/>
</head>
<body>
    <div class="main"></div>
    <select id="sel" title="language" name="sel">
        <option value="0">中文</option>
        <option value="1">英文</option>
        <option value="2">法文</option>
    </select>
    <script>
        var e = document.getElementById('sel');
        if(e.attachEvent){
            e.attachEvent("onchange",function(){
                var value = e.value,
                    links = document.getElementsByTagName('link'),
                    i = 0;
                if(value === '0'){
                    for(i=0;i<links.length;i++){
                        (links[i].title == "Chinese"||links[i].title == "") ?links[i].disabled = false:links[i].disabled = true;
                    }
                }else if(value ==="1"){
                    for(i=0;i<links.length;i++){
                        (links[i].title == "English"||links[i].title == "") ?links[i].disabled = false:links[i].disabled = true;
                    }
                }else{
                    for(i=0;i<links.length;i++){
                        (links[i].title == "French"||links[i].title == "") ?links[i].disabled = false:links[i].disabled = true;
                    }
                }
            });
        }else{
            e.addEventListener("change",function(){
                var value = e.value,
                    links = document.getElementsByTagName('link'),
                    i = 0;
                if(value === '0'){
                    for(i=0;i<links.length;i++){
                        (links[i].title == "Chinese"||links[i].title == "") ?links[i].disabled = false:links[i].disabled = true;
                    }
                }else if(value ==="1"){
                    for(i=0;i<links.length;i++){
                        (links[i].title == "English"||links[i].title == "") ?links[i].disabled = false:links[i].disabled = true;
                    }
                }else{
                    for(i=0;i<links.length;i++){
                        (links[i].title == "French"||links[i].title == "") ?links[i].disabled = false:links[i].disabled = true;
                    }
                }
            })
        }
    </script>
</body>
</html>